package com.huawei.appmarket.service.settings.card;

import android.content.Context;
import android.view.View;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.settings.bean.BaseSettingCardBean;
import java.util.Locale;
import o.cgz;
import o.der.d;
import o.Logger;

public class BaseSettingCard extends cgz {
    private View ˋ;
    protected Context ᐝ;

    public BaseSettingCard(Context context) {
        super(context);
        this.ᐝ = context;
    }

    public cgz ˏ(View view) {
        super.ˏ(view);
        this.ˋ = view.findViewById(d.ʾˋ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof BaseSettingCardBean) {
            ॱ((BaseSettingCardBean) cardBean);
        }
    }

    private void ॱ(BaseSettingCardBean baseSettingCardBean) {
        int i = 0;
        if (Logger.ˎ()) {
            Logger.ˏ("BaseSettingCard", String.format(Locale.ENGLISH, "updateDivider: card:%s bean:%s isDivider:%s isSectionLast:%s isEnableDivider:%s isPageLast:%s", new Object[]{getClass().getSimpleName(), baseSettingCardBean.getClass().getSimpleName(), Boolean.valueOf(baseSettingCardBean.ˊ()), Boolean.valueOf(baseSettingCardBean.ॱ()), Boolean.valueOf(baseSettingCardBean.ʽ()), Boolean.valueOf(baseSettingCardBean.ॱㆍ())}));
        }
        View view = this.ˋ;
        if (baseSettingCardBean.ˊ() || baseSettingCardBean.ॱ() || baseSettingCardBean.ॱㆍ() || !baseSettingCardBean.ʽ()) {
            i = 8;
        }
        ˎ(view, i);
    }

    private void ˎ(View view, int i) {
        if (view != null) {
            view.setVisibility(i);
        }
    }
}
